# 一些基本函数


import torch

# 创建稀疏数据
batch_size = 2
spatial_shape = [10, 10, 10]  # 3D空间尺寸
num_points = 100  # 每个batch中的非零点数
# 生成随机非零点和特征
indices = torch.cat([
    torch.randint(0, batch_size, (num_points, 1)),  # batch索引
    torch.randint(0, spatial_shape[0], (num_points, 1)),  # x坐标
    torch.randint(0, spatial_shape[1], (num_points, 1)),  # y坐标
    torch.randint(0, spatial_shape[2], (num_points, 1)),  # z坐标
], dim=1).int()

print(indices[:10])

for i in reversed(range(4)):
    print(i)
print("-"*20)
a = [1, 2, 3, 4]
print(a.pop(0))
print("-"*20)
a_dict = {"a": 1, "b": 2}
print(a_dict.pop("b"))
